#----------------------------
# Name: Chris Spooner
# Project: Madlibs.py
# Period: 2
# Start Date: 9/17/2013
# Last Revision Date: 9/17/2013
# Version: 1.0.0
#----------------------------

swearFilter = ["dumb",
               "stupid",
               "retard",
               "cunt",
               "cunt flaps",
               "stinky cunt",
               "Kick a cunt",
               "Fetus porn",
               "Fetal masturbation",
               "ass cheese",
               "ass clown",
               "ass hat",
               "ass fag",
               "faggot",
               "fag",
               "asshole",
               "ass leakage",
               "Ass slime",
               "Bondage",
               "Bondage gone wrong",
               "How the fuck did I lose my penis?",
               "Swastika",
               "Jew",
               "Jews",
               "Pee Pee touch",
               "Poo hole play",
               "asshole Andy",
               "Poo hole Pete",
               "Rectum Randy",
               "Butthole Bob",
               "Bum Bum Brady",
               "Ass fuck",
               "Fromunder Cheese",
               "Schlick",
               "weiner",
               "hotmail",
               "Stinky cunt juice",
               "Vag stank",
               "drugs",
               "Alaskan dog poop",
               "greens",
               "devil lettuce",
               "PAT",
               "Magic Salad",
               "Gods greens",
               "I do drugs",
               "Blue Dream",
               "G13",
               "Sour diesel",
               "Candy Kush",
               "OG Kush",
               "Afghan",
               "Grand Daddy Purps",
               "Northern Lights",
               "Blueberry gum",
               "marijuana",
               "keif",
               "hash",
               "bubble hash",
               "butane hash",
               "dabs",
               "dabs oil",
               "dabber",
               "torch",
               "torched",
               "burnt",
               "toast",
               "sturned",
               "twisted",
               "cranked",
               "crunk",
               "gone",
               "butt kiss",
               "blunts",
               "papers",
               "gold papers",
               "24k gold papers",
               "Would you pay $55 for that?",
               "Like, holy shit",
               "Holy Shit",
               "Mason Moore",
               "Lisa Ann",
               "Riley Steele",
               "Bridgette B",
               "Anais Alexander",
               "Laura Love",
               "Dylan Ryder",
               "Sasha Grey",
               "Afghan",
               "heroin",
               "chasing the dragon",
               "Virginia Tech"]

def displayStartScreen():
    print "Madlibs"
    raw_input("Press Enter to Continue")
    
def displayEndScreen():
    print "Goodbye"
    raw_input("Press Enter to Exit")

def getMenuOption(maxOption):
    option = ""
    goodOption = False
    while not goodOption:
        option = raw_input("Enter Number or Q> ")
        option = option.upper()
        for num in range(1, maxOption+1):
            if option == str(num):
                goodOption = True
        if option == 'Q':
            goodOption = True
        if not goodOption:
            print "Invalid input."
    return option
        
def menu(options):
    print "------Please Select a Story------"
    print " [1] The Origins of Pokemon"
    print " [2] Samurai Jack"
    print " [Q] Quit"
    print "----------------------------------"
    option = getMenuOption(options)
    return option
    
def getWord(prompt):
    word = ""
    goodWord = False
    while not goodWord:
        word = raw_input(prompt)
        if word.lower() not in swearFilter:
            goodWord = True
        else:
            print "HAH I thought of that word first ya fool."
        if not goodWord:
            print "Try again"
    return word
    
def getNumber(prompt, max = "", min = ""):
    num = ""
    goodNum = False
    while not goodNum:
        isNum = True
        num = raw_input(prompt)
        for character in num:
            if character not in "0123456789":
                isNum = False
        if min != "":
            if isNum:
                if float(num) < min:
                    isNum = False
        if max != "":
            if isNum:
                if float(num) > max:
                    isNum = False
        if isNum:
            goodNum = True
        else:
            print "Not a valid number, try again."
    return num
        
def story1():
    name1 = getWord("Enter a name: ")
    gender1 = getWord("Enter a gender: ")
    noun1 = getWord("Enter a noun: ")
    gerund1 = getWord("Enter a gerund: ")
    gerund2 = getWord("Enter a gerund: ")
    
    story = "Welcome to the wonderful world of Pokemon! You're about to embark on the adventure of a lifetime! First off, tell me your name."
    story += " " + name1 + ". "
    story += " " + name1 + ", " "is it? Now tell me, are you a boy or a girl?"
    story += " " + gender1 + ". "
    story += "Alright! Now you're ready to begin. This, is a pokemon! *pulls out a"
    story += " " + noun1 + "! " "*"
    story += "These creatures are used for"
    story += " " + gerund1 + "with others and" + gerund2 + "all by yourself. "
    story += "Soon you'll "
    print story
    
def story2():
    adjective1 = getWord("Enter an adjective: ")
    gerund1 = getWord("Enter a gerund: ")
    adnoun1 = getWord ("Enter a descriptive noun: ")
    gerund2 = getWord ("Enter a gerund: ")
    noun2 = getWord ("Enter a noun: ")
    
    story = "You might expect someone who's called Samurai Jack to be"
    story += " " + adjective1 + ", " 
    story += "however, this story follows a loser, not someone who is"
    story += " " + adjective1 + "."
    story += "No one knows how Jack earned his title, some assume it was through"
    story += " " + verb1 + " "
    story += "or maybe with a little"
    story += " " + adnoun1 + " "
    story += "but this story was written to correct those prejudices."
    story += "Samurai Jack often starts his day by"
    story += " " + verb2 + " "
    story += "out of his"
    story += " " + noun2 + " "
    print story
    
def run():
    displayStartScreen()
    choice = ""
    while choice != 'Q':
        choice = menu(2)
        if choice == '1':
            story1()
        elif choice == '2':
            story2()
        elif choice == 'Q':
            displayEndScreen()
        else:
            print "Someone, somewhere, has done something wrong."
    exit()
run()